package calendario_teste;
import javax.swing.*;
import java.awt.*;

public class CanvasTeste extends JApplet {
  JLabel Title;
  CustomCanvas DrawingArea;
  
  public CanvasTeste () {
    Container Pane;

    Pane = getContentPane();
    Title = new JLabel ("The JLabel is in the SOUTH area");
    DrawingArea = new CustomCanvas();
    Pane.add (Title, BorderLayout.SOUTH);
    Pane.add (DrawingArea, BorderLayout.CENTER);
  }

}

class CustomCanvas extends Canvas {

  public CustomCanvas () {
    setBackground (Color.yellow);
  }

  public void paint (Graphics g) {
    Graphics2D g2;
    int Height;

    g2 = (Graphics2D) g;
    Height = getHeight();
    g2.drawString ("The CustomCanvas is in the CENTER area", 10, Height/2);
  }
}